package com.idemon.config;

public final class Consts {
	public static final String FILENAME_CONFIG = "config.properties";

	public static final String KEY_DEVMODE = "devMode";
	public static final String KEY_ENCODING = "encoding";
	public static final String KEY_FREEMARKER_DELAY = "freemarker_template_update_delay";
	public static final String KEY_FILE_UPLOAD_PATH = "file.upload.path";
	public static final String KEY_FILE_UPLOAD_SIZE = "file.upload.size";
	public static final String KEY_PROJECT_NAME = "project.name";
	
	public static final String KEY_JDBCURL = "jdbcUrl";
	public static final String KEY_USER = "user";
	public static final String KEY_PASSWORD = "password";
	public static final String KEY_FRONT_BASE_VIEW_PATH = "frontBaseViewPath";
	public static final String KEY_MYSQL = "mysql";
	public static final String KEY_RECORD_NUM = "record.num";
	
	public static final String ATTR_KEY_SESSION_VALIDATECODE = "SESSION_VALIDATECODE";
	public static final String ATTR_KEY_SESSION_USER = "SESSION_USER";
	public static final String ATTR_KEY_SESSION_BACKUP_URL = "SESSION_BACKUP_URL";
	public static final String ATTR_KEY_CATEGORY_LIST = "initCategoryList";
	public static final String ATTR_KEY_CATEGORY_LIST_TIMESTAMP = "initCategoryListTimestamp";
	public static final String ATTR_KEY_CONTEXT_PATH = "contextPath";
	public static final String ATTR_KEY_INIT_DATA_OUTTIME = "attr.init.data.outtime";
	
	public static final String CACHE_KEY_SOFT_NEW = "cachesoftnew";
	public static final String CACHE_KEY_SOFT_MAXDOWN = "cachesoftmaxdown";
	public static final String CACHE_KEY_SOFT_RELATE = "cachesoftrelate";
		
	public static final long DEFAULT_INIT_DATA_OUTTIME = 86400000;
	public static final int DEFAULT_RECORD_NUM = 5;
	public static final int DEFAULT_RECORD_NUM_RELATE = 4;
	public static final String DEFAULT_URL_INDEX = "index.html";
	public static final String DEFAULT_URL_LOGIN = "login.html";
	public static final String DEFAULT_ENCODING = "UTF-8";
	public static final int DEFAULT_FILE_UPLOAD_SIZE = 5241880;
	
	public static long ONLINE_COUNT = 0;
	public static long LOGIN_USER_COUNT = 0;
	
	public static String getTypeName(int typeId){
		switch (typeId) {
		case 1:
			return "软件";
		case 2:
			return "教程";
		case 3:
			return "搜索";
		default:
			return "";
		}
	}
}
